package pl.prv.polanie.client.dto;

import pl.prv.polanie.client.model.ContextSettings;

import com.google.gwt.user.client.rpc.IsSerializable;



/**
 * SemesterDTO entity. @author MyEclipse Persistence Tools
 */

public class CSVSemesterDTO extends java.lang.Object implements IsSerializable {


    // Fields    
	private long id;
	private String studiesType;
    private String semesterType;
    private String yearNumber;
    private boolean visibleForOrdinaryUsers;

    // Constructors



	/** default constructor */
    public CSVSemesterDTO() {
    }

    
    /** full constructor */
    public CSVSemesterDTO(long id, String studiesType, String semesterType,
			String yearNumber, boolean visibleForOrdinaryUsers) {
		super();
		this.id = id;
		this.studiesType = studiesType;
		this.semesterType = semesterType;
		this.yearNumber = yearNumber;
		this.visibleForOrdinaryUsers = visibleForOrdinaryUsers;
	}

    
    
   
    // Property accessors

    
    public String getStudiesType() {
		return studiesType;
	}


	public void setStudiesType(String studiesType) {
		this.studiesType = studiesType;
	}


	public String getSemesterType() {
		return semesterType;
	}


	public void setSemesterType(String semesterType) {
		this.semesterType = semesterType;
	}


	public String getYearNumber() {
		return yearNumber;
	}


	public void setYearNumber(String yearNumber) {
		this.yearNumber = yearNumber;
	}


	public String toLabel() {
    	String result;
    	Integer nextYear = new Integer(yearNumber) + 1;
    	String visible = "-";
    	if (visibleForOrdinaryUsers) {
    		visible = "+";
    	}
    		
    	if (ContextSettings.isGuiDebugMode()) {
    		result = visible + yearNumber + "/" + nextYear + ", " + semesterType + ", " + studiesType + " [" + id + "]";
    	} else {
    		result = visible + yearNumber + "/" + nextYear + ", " + semesterType + ", " + studiesType;
    	}
    	return result;
    }

	public String toLabelForSorting() {
    	String result;
    	Integer nextYear = new Integer(yearNumber) + 1;
    		
    	if (ContextSettings.isGuiDebugMode()) {
    		result = yearNumber + "/" + nextYear + ", " + semesterType + ", " + studiesType + " [" + id + "]";
    	} else {
    		result = yearNumber + "/" + nextYear + ", " + semesterType + ", " + studiesType;
    	}
    	return result;
    }
	
	public long getId() {
		return id;
	}


	public void setId(long id) {
		this.id = id;
	}


	public boolean isVisibleForOrdinaryUsers() {
		return visibleForOrdinaryUsers;
	}


	public void setVisibleForOrdinaryUsers(boolean visibleForOrdinaryUsers) {
		this.visibleForOrdinaryUsers = visibleForOrdinaryUsers;
	}


	
}